ISayYouDo Invoke API
The isayyoudo REST API provides operations for invoking the function of the Outsay box mapped to an In Say Box.
Eg: If you have mapped the "SMS Alerts" Out-Say Box to your In-Say Box, you will be able to invoke the SMS sending function through this API.
Supported Services
ISYD INVOKE SERVICE : This allows you to invoke the function of the Out-Say Box you have mapped.
Requirements
Authorization of API Calls
All API call requests to ideabiz.lk require Authorization headers. Please refer the Token Management (http://docs.ideabiz.lk/Getting_Started/Token_Manegment) document for Authorization.
Request Header
Content-Type:application/json
Accept: text/plain
Authorization: Bearer [access token]
Sample Requested Header
Content-Type:application/json
Accept: text/plain
Authorization: Bearer fdfd73843894hdfdfdf2323023fff
Invoke Service
On I Say You Do, the activating of an action specified in a Do Box (recipe) that the end user creates, is done by the Invoke Service of this API. This API should be invoked when the conditions (triggers) configured by the end user in the In Say Box, are met.
Eg: CNN News Say Box. If the user has entered a filter keyword named "Global Warming", and wishes to receive SMS alerts. Whenever an article on CNN with the keyword "Global Warming" is detected, the ISayYouDo Invoke API should be called.
URL
https://ideabiz.lk/apicall/isayyoudo/1.0/invokeUserCondition
Content Type
application/JSON
Method
POST
Invoke Service in ISYD LIMITED ENVIRONMENT
Request Body
{
"activeStatus": 4,
"outputObject": {
"result": ""
},
"settingsObject": {},
"sessionId": 123456,
"userId": 123
}
Response Body
{
"status": 1,
"description": "success"
}
Invoke Service in ISYD LIVE ENVIRONMENT
Request Body
{
"activeStatus": 1,
"outputObject": {
"result": ""
},
"settingsObject": {},
"sessionId": 123456,
"userId": 123
}
Response Body
{
"status": 1,
"description": "success"
}
Parameter Details
Parameter Name | Description | Type | Mandatory/Optional |
---|---|---|---|
activeStatus | This is the status of the Say Box. Limited Environment status = 4 Live Environment status=1 |
Numeric | Mandatory |
outputObject | Please check below for an elaborate explanation on this object*. | Jsonobject | Mandatory |
sessionId | Unique ID for the user recipe. This ID is sent to you when a user creates a recipe (Do Box) | Numeric | Mandatory |
UserId | Unique ID for the user | Numeric | Mandatory |
*outputObject
This is the object that contains the result that will be sent to the user. The parameter that is contained inside the outputObject should contain the result that is to be pushed to the user. Examples for result can be content for an SMS or Email Alerts, on/off status for a connected device
Refer the below example of using this result parameter.
Using the pre-existing "SMS Alerts" and "Email Alerts" Out-Say Boxes
When using the pre-existing SMS Alerts and Email Alerts Out-Say boxes to send alerts to users, the following format is to be used when calling the ISYD Invoke API.
You can replace $result (in this case the code was written in PHP) with the variable containing the data you wish to send to your user.
"outputObject": {
"result": "$result"
}